import { _decorator, CCFloat, CCInteger, Component, Enum } from "cc";

const { ccclass, property } = _decorator;

enum FlexItemAlign {
    Auto = 0,
    FlexStart,
    FlexEnd,
    Center,
    Baseline,
    Stretch
}

@ccclass('FlexItem')
export class FlexItem extends Component {
    @property({ type: CCInteger, tooltip: "定义项目的排列顺序，数值越小越靠前" })
    order = 0;

    @property({ type: CCFloat, tooltip: "定义项目的放大比例" })
    flex_grow = 0;

    @property({ type: Enum(FlexItemAlign), tooltip: "允许单个项目有与其他项目不一样的对齐方式" })
    align_self: FlexItemAlign = FlexItemAlign.Auto;
}